Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yield parent directory before reading it #188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fdiakh
Copy link

@fdiakh fdiakh commented Oct 23, 2023

I have a use case similar to #168 and stumbled upon the same issue. Here is an attempt at fixing it:

The first commit fixes the issue when using a non-sorted walkdir and doesn't change too much code (assuming I haven't missed anything ...)

The second commit fixes the issue when using a sorter as well and requires moving things around a bit more (feel free to drop this one if you'd rather merge a smaller change).

I also added a test case for the bug described in #168

Fixes: #168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

contents_first(false) still calls readdir before emitting the parent directory
1 participant